#! /usr/bin/python
from random import randint
from random import choice

INSTANCIAS = 70

MAX_CLAUS = 300
MAX_VARS = 40
MAX_VARS_POR_CLAUS = 10

f = open("hard_big.in",'w')
clausulas=open("hard_big_tamanios",'w')

for i in xrange(INSTANCIAS):
	c = randint(1,MAX_CLAUS)
	clausulas.write(str(c)+"\n")
	v = randint(1,MAX_VARS)
	f.write("%d %d\r\n"%(c,v))
	mvpc=randint(3,MAX_VARS_POR_CLAUS)
	for j in xrange(c):
		l = randint(1,mvpc)
		f.write(" %d\t\t"%l)
		for k in xrange(l):
			s = choice([-1,1])
			f.write((s>0 and " " or "")+"%d\t"%(s*randint(1,v)))
		f.write('\r\n')

f.write('-1 -1\r\n')

f.close()
